import http from "./http.ts"

type User = {
    userName?: string;
    password?: string;
};

type paramsType = object | null | undefined
// 字典
export const dicAll = () => {
    return http.post('/index-web-api/sys/dic/all')
}
// 公用的上传接口
export const uploadPublic = (data?: paramsType) => {
    return http.post('/product-web-api/file/upload/public', data, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    })
}
// 登录
export const loginApi = (data?: paramsType) => {
    return http.post('/index-web-api/webuser/login', data)
}
// 车险保单列表
export const CarInformation = (data?: paramsType) => {
    return http.post('/policy-web-api/car/queryCarPolicyList', data)
}
// 车险保单-批量导出
export const csvCarExport = (data?: paramsType) => {
    return http.post('/policy-web-api/car/csvExport', data)
}
// 车险详情
export const queryForUpdateCar = (data?: paramsType) => {
    return http.post('/policy-web-api/car/queryForUpdateCar', data)
}
// 选择客户
export const queryAllCusInfoList = (data?: paramsType) => {
    return http.post('/ucenter-web-api/customer/queryAllCusInfoList', data, {noLoading: false})
}
// 车险-保单号校验
export const verifyCarPolicyCode = (data?: paramsType) => {
    return http.post('/policy-web-api/car/verifyCarPolicyCode', data, {noLoading: false})
}
// 车险-保单号校验
export const querySaleListForProject = (data?: paramsType) => {
    return http.post('/ucenter-web-api/userInformation/querySaleListForProject', data, {noLoading: false})
}
// 获取项目名称
export const queryAllProjectList = (data?: paramsType) => {
    return http.post('/ucenter-web-api/project/queryAllProjectList', data)
}
// 经纪人信息管理——通过power查询orgPath
export const queryOrgPathList = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/queryOrgPathList', data)
}
// 保险公司下拉列表
export const queryAllCompany = (data?: paramsType) => {
    return http.post('/product-web-api/companymanage/queryallcompany', data)
}
// 产品库列表
export const queryProductLibraryList = (data?: paramsType) => {
    return http.post('/product-web-api/information/findInfoList', data)
}
//产品信息状态修改
export const updateProductStatus = (data?: paramsType) => {
    return http.post('/product-web-api/information/updateStatus', data)
}

//导出产品信息EXCEL
export const exportProduct = (data?: paramsType) => {
    return http.post('/product-web-api/information/exportExcel', data, {
        responseType: 'blob'
    })
}
// 获取产品信息
export const getProductInfo = (data?: paramsType) => {
    return http.post('/product-web-api/information/detail', data)
}
// 获取销售渠道
export const getSealChannel = (data?: paramsType) => {
    return http.post('/product-web-api/information/sealChannel', data)
}
// 获取所属机构
export const queryRootMeun = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/queryRootMeun', data)
}
// 根据保险公司代码查询分支机构列表
export const companyCodeQueryOrgList = (data?: paramsType) => {
    return http.post('/product-web-api/companyorgmanage/companycodequeryorglist', data, {noLoading: false})
}
// 获取险种列表
export const queryRiskInfo = (data?: paramsType) => {
    return http.post('/policy-web-api/risk/queryriskinfo', data)
}
// 获取险种列表
export const queryRiskList = (data?: paramsType) => {
    return http.post('/product-web-api/risk/queryRiskList', data)
}
// 获取所有地区数据
export const getAllArea = (params?: paramsType) => {
    return http.get('/product-web-api/dictionary/getAllArea', {params, noLoading: false})
}
// 获取所有地区数据
export const startProcess = (params?: paramsType) => {
    return http.post('/oa-web-api/oaprocess/startProcess', params)
}
// oa查ProcessId
export const queryIdByProcessId = (params?: paramsType) => {
    return http.get('/oa-web-api/oaprocess/queryIdByProcessId', {params})
}
// oa查流程详情
export const searchById = (params?: paramsType) => {
    return http.get('/oa-web-api/oaprocess/searchById', {params})
}
// oa查已提交流程详情
export const processDetails = (params?: paramsType) => {
    return http.get('/oa-web-api/oaprocess/processDetails', {params})
}
// 我的申请
export const myProcessApplication = (data?: paramsType) => {
    return http.post('/oa-web-api/oaprocess/myProcessApplication', data)
}
// OA我的申请获取待审人员
export const getOACheckPerson = (params?: paramsType) => {
    return http.get('/oa-web-api/oaprocess/queryAssignee', {params, noLoading: false})
}
// 我的任务
export const queryToDoTasks = (data?: paramsType) => {
    return http.post('/oa-web-api/oaprocess/queryToDoTasks', data)
}
// oa查任务详情
export const taskDetails = (data?: paramsType) => {
    return http.post('/oa-web-api/oaprocess/taskDetails', data)
}
// oa审批
export const processingApproval = (data?: paramsType) => {
    return http.post('/oa-web-api/oaprocess/processingApproval', data)
}
// 审批结果
export const reviewCommentsView = (params?: paramsType) => {
    return http.get('/oa-web-api/oaprocess/reviewCommentsView', {params})
}
// 机构信息列表
export const queryConditionOrg = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/queryConditionOrg', data)
}
// 机构管理——排序——上移/下移
export const orgMoveSort = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/moveSort', data)
}
//机构管理——数据导出
export const exportOrgInformation = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/exportOrgInformation', data, {
        responseType: 'blob'
    })
}
// 机构管理——负责人列表
export const orgSearchNameList = (data?: paramsType) => {
    return http.post('/index-web-api/webuser/searchNameList', data)
}
// 机构管理———通过上级机构查询机构级别
export const queryOrgClassBySuperCode = (data?: paramsType) => {
    return http.post(`/ucenter-web-api/organizationalmanagement/queryOrgclass?orgSuperCode=${data?.orgSuperCode}`, {})
}
// 机构管理———新增机构
export const insertOrg = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/insertOrg', data)
}
// 机构管理———更新修改机构
export const updateOrg = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/updateOrg', data)
}
//导出产品信息EXCEL
export const qrCodeGeneration = (data?: paramsType) => {
    return http.post('ucenter-web-api/saleWeb/qrCodeGeneration', data, {
        responseType: 'blob'
    })
}
// 机构管理———注销机构
export const logoutOrg = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/cancellationOrg?id=' + data?.id + '&orgPath=' + data?.orgPath, data)
}
// 机构管理———删除机构
export const deleteOrg = (data?: paramsType) => {
    return http.post('/ucenter-web-api/organizationalmanagement/deleteOrg?id=' + data?.id + '&orgCode=' + data?.orgCode, data)
}
// 表格组件需要
export default {
    CarInformation,
    queryProductLibraryList,
    myProcessApplication,
    queryToDoTasks,
    queryConditionOrg
}